﻿using System.Collections.Generic;

namespace Maltose.Data
{
    /// <summary>
    /// 分页数据
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class SqlPageData<T>
    {
        /// <summary>
        /// 核心数据
        /// </summary>
        public IEnumerable<T> Data { get; set; }

        /// <summary>
        /// 当前页页码
        /// </summary>
        public int PageIndex { get; set; }

        /// <summary>
        /// 当前页分页页数量
        /// </summary>
        public int PageSize { get; set; }

        /// <summary>
        /// 分页数据总和
        /// </summary>
        public long DataCount { get; set; }
    }

    /// <summary>
    /// 返回统计的值
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class SqlPageDataSum<T> : SqlPageData<T>
    {
        /// <summary>
        /// 自定义数据
        /// </summary>
        public Dictionary<string, double> SumData { get; set; } = new Dictionary<string, double>();
    }
}
